package com.liuanbang.saro.sarodemo.base;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * fragmentPager通用适配器
 */
public abstract class AbstractFragmentPagerAdapter extends FragmentPagerAdapter {

    protected List<Fragment> fragmentList = new ArrayList<Fragment>();

    public AbstractFragmentPagerAdapter(FragmentManager fragmentManager, List<Fragment> fragmentList) {
        super(fragmentManager);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
